package net.towee.client.event.core;

import net.towee.model.account.AccountIdentity;

import com.google.gwt.event.shared.GwtEvent;

public class ContactAddedEvent extends GwtEvent<ContactAddedHandler> {
	public static Type<ContactAddedHandler> TYPE = new Type<ContactAddedHandler>();
	private final AccountIdentity identity;
	private final String id;

	public ContactAddedEvent(AccountIdentity idnt, String contactsGroupId) {
		this.identity = idnt;
		this.id = contactsGroupId; 
	}

	@Override
	public Type<ContactAddedHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(ContactAddedHandler handler) {
		handler.onContactAdded(identity, id);
	}

}
